#ifndef BasicFun_H
#define BasicFun_H

#include "GlobalVar.h"
float LeastSquare(int* array, int row1, int row2);

int ArrayMax(int* Array, int n);
int ArrayMin(int* Array, int n);

int IsEdge(int row, int col);
int SearchUpEdge(int row, int col);
int SearchDownEdge(int row, int col);
int SearchLeftEdge(int row, int col);
int SearchRightEdge(int row, int col);
int SearchLeftNoEdge(int row, int col);
int SearchRightNoEdge(int row, int col);
Point SearchLeftUpEdge(int row, int col);
Point SearchRightUpEdge(int row, int col);
Point SearchLeftDownEdge(int row, int col);
Point SearchRightDownEdge(int row, int col);
Point SearchLeftUpEdge45(int row, int col);
Point SearchRightUpEdge45(int row, int col);

int GetLL(int row, int col);
int GetRL(int row, int col);
int AveGray(void);
int RegionAveGray(int row, int left_col, int right_col);

int MaxArray(int* line, int n);
int MinArray(int* line, int n);
signed int TrendArray(int* line, int n);
void AveFilter(int* line, int n);
int IsBigWave(int* line, int n);

int JudgeCurveEdge(int up_row, int down_row, int type);
#endif //!BasicFun_H